<?php

/**
 * Reclamo form.
 *
 * @package    aeropostal
 * @subpackage form
 * @author     Your name here
 */
class ReclamoForm extends BaseReclamoForm
{
  public function configure()
  {
      $this->setWidgets(array(
      'numero'        => new sfWidgetFormInputText(),
      'fecha'         => new sfWidgetFormInputText(),
      'numeroFactura' => new sfWidgetFormPropelChoice(array('model' => 'Factura', 'add_empty' => '- Seleccione -', 'key_method' => 'getNumero')),
      'descripcion'   => new sfWidgetFormInputText(),
      'estatus'       => new sfWidgetFormInputText(),
      'fechaTrans'    => new sfWidgetFormInputText(),
      'numTrans'      => new sfWidgetFormInputText(),
      'numAprob'      => new sfWidgetFormInputText(),
      'fechaAprob'    => new sfWidgetFormInputText(),
      'numNota'       => new sfWidgetFormInputText(),
      'fechaNota'     => new sfWidgetFormInputText(),
      'tipoNota'      => new sfWidgetFormInputText(),
      'montoNota'     => new sfWidgetFormInputText(),
    ));
      
    $this->setValidators(array(
      'numero'        => new sfValidatorString(array('max_length' => 255)),
      'fecha'         => new sfValidatorDate(),
      'numeroFactura' => new sfValidatorPropelChoice(array('model' => 'Factura', 'column' => 'numero')),
      'descripcion'   => new sfValidatorString(array('max_length' => 500)),
      'estatus'       => new sfValidatorString(array('max_length' => 255)),
      'fechaTrans'    => new sfValidatorDate(array('required' => false)),
      'numTrans'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'numAprob'      => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'fechaAprob'    => new sfValidatorDate(array('required' => false)),
      'numNota'       => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'fechaNota'     => new sfValidatorDate(array('required' => false)),
      'tipoNota'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'montoNota'     => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('reclamo[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
  }
}
